CC = sdcc

ihx2hex = packihx

# 定义输出目录变量
BUILD_DIR = Build

# 编译选项
# 输出详细编译过程
# 内部存储空间大小 64k
# 内部RAM大小 256字节
# 内部拓展RAM大小 4K字节 相当于内部集成51的外部RAM拓展
CFLAGS = -V \
--code-size 0x10000 \
--iram-size 0x100 \
--xram-size 0x1000 \
-mmcs51 \
--model-large

all:
	mkdir mkdir -p ${BUILD_DIR}
	${CC} -I System ${CFLAGS} User/main.c -o ${BUILD_DIR}/project.ihx
	${ihx2hex} ${BUILD_DIR}/project.ihx > ${BUILD_DIR}/project.hex
	make show

.PHONY: clean show
clean:
	rm -rf ${BUILD_DIR}/**
show:
	cat Build/project.mem

